package com.lm.guava.controller;

import com.lm.guava.anno.RateLimit;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ApiController {

    @RateLimit(permitsPerSecond = 2.0) // 每秒最多 2 次请求
    @GetMapping("/api/data")
    public String getData() {
        return "成功返回数据";
    }
}
